interface DateRollType {
  toggleShow(): void;
}

const useSelMon = defineStore("selMon", () => {
  const curMon = ref<string | number>(1);
  const monRef = ref<DateRollType>();
  function initMonth(newMonth: string | number = 1) {
    // console.log(newMonth);
    curMon.value = newMonth;
  }
  const toggleMonth = () => {
    if (monRef.value) {
      monRef.value.toggleShow();
    } else {
      console.warn(`monRef is not initialized or is null.`);
    }
  };

  return {
    monRef,
    toggleMonth,
    initMonth,
    curMon
  };
});
export const useSelMonRefs = () => storeToRefs(useSelMon());
export default useSelMon;
